Skip to content

refactor(web-ui): extract flow chat scroll stability helpers - #1822

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev2
Jul 28, 2026
Merged

refactor(web-ui): extract flow chat scroll stability helpers#1822
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev2

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extract Flow Chat viewport reservation types and pure stability calculations from VirtualMessageList.tsx.
  • Keep the React component module free of non-component runtime exports.
  • Update focused tests to import the extracted helpers from their dedicated module.

Fixes #

Type and Areas

Type:

Refactor

Areas:

Web UI, Flow Chat, virtualized message list

Motivation / Impact

VirtualMessageList.tsx exported several non-component helper functions so they could be tested directly. This triggered eight react-refresh/only-export-components warnings and made the component module incompatible with React Fast Refresh expectations.

The helpers now live in a dedicated pure logic module. This is a behavior-preserving refactor with no direct user-facing change.

Verification

  • pnpm run lint:web — passed with 0 warnings and 0 errors
  • pnpm run type-check:web — passed
  • pnpm --dir src/web-ui run test:run src/flow_chat/components/modern/VirtualMessageList.session-boundary.test.tsx src/flow_chat/components/modern/FlowChatViewportCoordinator.test.ts src/flow_chat/tool-cards/useToolCardHeightContract.test.tsx src/flow_chat/tool-cards/TodoWriteDisplay.test.tsx — 4 files and 38 tests passed
  • git diff --check — passed

Reviewer Notes

This change only relocates existing reservation and scroll-stability calculations. VirtualMessageList and its tests consume the same functions through the new flowChatScrollStability.ts module.

No user-facing strings, locale resources, or public contracts were changed.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

- move viewport reservation types and calculations into a dedicated module
- keep VirtualMessageList compatible with React Fast Refresh
- update focused tests to import the extracted helpers directly
- preserve existing scroll stabilization behavior
@wsp1911
wsp1911 merged commit 550388a into GCWing:main Jul 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant